feat: GitHub and Linear connectors (#85, #101)#142
Conversation
github/create_issue — POST /repos/{owner}/{repo}/issues with title, body,
labels, and assignees. Returns number, url, node_id, state.
github/dispatch — POST /repos/{owner}/{repo}/dispatches for repository_dispatch
events with optional client_payload.
linear/create_issue — GraphQL IssueCreate mutation with team_id, title,
description, assignee_id, project_id, priority, and label_ids. Returns id,
identifier, url, title.
linear/search — GraphQL Issues query with optional title/team/assignee/state
filters and configurable limit (default 25). Returns issues array and count.
All four connectors follow the _credential/token pattern, delete the credential
key from params after extraction, use httptest servers in tests, and are
registered in NewRegistry.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 57 minutes and 18 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds first-party GitHub (REST) and Linear (GraphQL) connectors to the engine’s built-in connector registry, along with unit tests using httptest servers.
Changes:
- Introduces
github/create_issueandgithub/dispatchconnectors with request/response shaping and credential extraction. - Introduces
linear/create_issueandlinear/searchconnectors with a shared GraphQL request helper. - Registers all four connectors in
NewRegistryand adds corresponding unit tests.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/engine/internal/connector/linear.go | Adds Linear GraphQL connectors + shared GraphQL request helper and param extraction helpers. |
| packages/engine/internal/connector/linear_test.go | Adds unit tests for Linear connectors and registry wiring. |
| packages/engine/internal/connector/github.go | Adds GitHub REST connectors + shared HTTP client helper and slice conversion helper. |
| packages/engine/internal/connector/github_test.go | Adds unit tests for GitHub connectors and registry wiring. |
| packages/engine/internal/connector/connector.go | Registers new GitHub and Linear connectors in the built-in registry. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Validate priority range (0–4) in linear/create_issue; return error early - Replace duplicate extractIntParam with shared extractInt (handles int64) - Rename shadowed body var to respBody in github/dispatch error path - Add TestLinearCreateIssueConnector_InvalidPriority test Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
Adds four new built-in connectors — two for GitHub (REST) and two for Linear (GraphQL).
GitHub (
_credential:{token: "ghp_..."})github/create_issue— creates an issue in any repo. Params:owner,repo,title; optionalbody,labels,assignees. Returnsnumber,url,node_id,state.github/dispatch— fires arepository_dispatchevent. Params:owner,repo,event_type; optionalclient_payload. Returns{ok: true}.Linear (
_credential:{token: "lin_api_..."})linear/create_issue— creates an issue via GraphQLIssueCreate. Params:team_id,title; optionaldescription,assignee_id,project_id,priority(0–4),label_ids. Returnsid,identifier,url,title.linear/search— queries issues via GraphQL with optionalquery(title contains),team_id,assignee_id,statefilters and configurablelimit(default 25). Returnsissuesarray andcount.All connectors follow the established
_credentialpattern (deleted from params after extraction), usehttptestservers in unit tests, and are registered inNewRegistry.Test plan
go test ./internal/connector/ -run "TestGitHub|TestLinear"— 21 tests all passgo build ./...andgo vet ./...pass cleangithub/create_issue,github/dispatch,linear/create_issue,linear/search🤖 Generated with Claude Code